package com.joysuch.wwyt.mh.storage;

import lombok.Getter;

public enum MonitorPointDataType {

    BOOL("bool"), INTEGER("integer"), FLOAT("float"), STRING("string");

    @Getter
    private String dataType;
    private MonitorPointDataType(String dataType) {
        this.dataType = dataType;
    }

    public static MonitorPointDataType of(String dataType) {
        MonitorPointDataType[] values = MonitorPointDataType.values();
        for (MonitorPointDataType val : values) {
            if (val.getDataType().equals(dataType)) {
                return val;
            }
        }
        throw new IllegalArgumentException("illegal data type:" + dataType);
    }
}
